<?php
class ProjectAssign extends AppModel {
	var $name = 'ProjectAssign';
	var $validate = array(
		'project_year_id' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				'message' => 'Chọn năm thực hiện đề tài',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'project_category_id' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				'message' => 'Chọn lĩnh vực đăng ký',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'user_id' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				'message' => 'Chọn giáo viên hướng dẫn',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'number' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				'message' => 'Số lượng sinh viên hướng dẫn',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
	);
	//The Associations below have been created with all possible keys, those that are not needed can be removed

	var $belongsTo = array(
		'ProjectYear' => array(
			'className' => 'ProjectYear',
			'foreignKey' => 'project_year_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'ProjectCategory' => array(
			'className' => 'ProjectCategory',
			'foreignKey' => 'project_category_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'User' => array(
			'className' => 'User',
			'foreignKey' => 'user_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
}
?>